package com.gong.bank.controller;

import com.gong.bank.factory.LogBean;
import com.gong.bank.service.BankService;
import com.gong.bank.service.BankServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.ResultSet;
import java.util.List;

/**
 * @description:
 * @author:gong
 * @create: 4/8/2022 下午2:20
 */
public class LogController extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        BankService service = new BankServiceImpl();
        List<LogBean> logList = service.selectAllLog();
        req.setAttribute("log",logList);

        req.getRequestDispatcher("log.jsp").forward(req,resp);
    }
}
